﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.Concurrent;
using System.Collections;

namespace intelliSys.NankaiUtilities.EventSynchronizer
{
    public class LiveEvents : ConcurrentBag<LiveEvent>
    {
    }
    public class LiveEvent
    {
        public string Title { get; set; }
        public string Location { get; set; }
        public DateTime StartTime { get; set; }
        public DateTime EndTime { get; set; }
        public string Link { get; set; }
        public ILiveEventSource EventSource { get; set; }

        public string GetStartTimeJSONReadyString()
        {
            return Helpers.CreateJSONReadyDateTimeString(StartTime);
        }

        public string GetEndTimeJSONReadyString()
        {
            return Helpers.CreateJSONReadyDateTimeString(EndTime);
        }

        public string Description { get; set; }
        public bool AttentionRequested
        {
            get
            {
                return StartTime == default(DateTime) || Location == "";
            }
        }
        public override bool Equals(object obj)
        {
            var le = obj as LiveEvent;
            if (le == null) return false;
            return le.Link == this.Link;
        }
    }


}
